package com.sxy.demo.sxy;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(
            value = "id",
            type = IdType.AUTO
    )
    private Long id;

    @TableField(
            fill = FieldFill.INSERT
    )
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonFormat(
            shape = JsonFormat.Shape.STRING,
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date createTime;

    @TableField(
            fill = FieldFill.INSERT
    )
    private Long createUser;


    @TableField(
            fill = FieldFill.INSERT_UPDATE
    )
    private Long updateUser;


    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonFormat(
            shape = JsonFormat.Shape.STRING,
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @TableField(
            fill = FieldFill.INSERT_UPDATE
    )
    private Date updateTime;


    private Integer deleted;

}
